home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / ddn-news / ddn-mgt-bulletin-58.txt < prev    next >
Text File  |  1991-07-10  |  4KB  |  119 lines

  1. **********************************************************************
  2. DDN MGT Bulletin 58              DCA DDN Defense Communications System
  3. 24 Apr 89                        Published by: DDN Network Info Center
  4.                                     (NIC@SRI-NIC.ARPA)  (800) 235-3155
  5.  
  6.                         DEFENSE  DATA  NETWORK
  7.                          MANAGEMENT  BULLETIN
  8.  
  9. The DDN MANAGEMENT BULLETIN is distributed online by the DDN Network
  10. Information Center under DCA contract as a means of communicating
  11. official policy, procedures and other information of concern to
  12. management personnel at DDN facilities.  Back issues may be read
  13. through the TACNEWS server ("@n" command at the TAC) or may be
  14. obtained by FTP (or Kermit) from the SRI-NIC host [26.0.0.73 or
  15. 10.0.0.51] using login="anonymous" and password="guest".  The pathname
  16. for bulletins is DDN-NEWS:DDN-MGT-BULLETIN-nn.TXT (where "nn" is the
  17. bulletin number).
  18.  
  19. **********************************************************************
  20.  
  21.            SECURITY PROBLEM IN `FCHOWN' COMMAND
  22.  
  23. APPLICABLE OPERATING SYSTEM:  UNIX (unmodified 4.3BSD and 4.3BSD-tahoe)
  24.  
  25.   PROBLEM: There's a security problem associated with 4.3BSD and
  26.            4.3BSD-tahoe systems involving the chown(2) system call.
  27.  
  28.    STATUS: The enclosed fix was broadcast on comp.bugs.4bsd.ucb-fixes as
  29.            patch V1.77.
  30.  
  31.  
  32.  CONTACTS: CERT at (412) 268-7090  for general problem information.
  33.            SRI/NIC at 1-800-235-3155 for general information.
  34.            Your vendor for your site-specific information.
  35.  
  36.   NOTE(1): This bulletin represents the best information available
  37.            at this time to fix this problem.  As with any program
  38.            modification, CHECK WITH YOUR VENDOR BEFORE APPLYING.
  39.  
  40.   NOTE(2): Only those sites which have acquired these operating systems
  41.            directly from Berkeley sources and not through a vendor are
  42.            known to be affected.  It may exist in 4.3BSD derived systems;
  43.            contact your vendor for more information.
  44.  
  45.  
  46. - ---------------------------- PATCH FOLLOWS ----------------------------
  47.  
  48. *** /tmp/d04748    Thu Jan 26 21:04:17 1989
  49. - --- ufs_syscalls.c    Wed Jan 25 09:44:50 1989
  50. ***************
  51. *** 3,9 ****
  52.    * All rights reserved.  The Berkeley software License Agreement
  53.    * specifies the terms and conditions for redistribution.
  54.    *
  55. !  *    @(#)ufs_syscalls.c    7.3 (Berkeley) 4/18/87
  56.    */
  57.   
  58.   #include "param.h"
  59. - --- 3,9 ----
  60.    * All rights reserved.  The Berkeley software License Agreement
  61.    * specifies the terms and conditions for redistribution.
  62.    *
  63. !  *    @(#)ufs_syscalls.c    7.4 (Berkeley) 1/24/89
  64.    */
  65.   
  66.   #include "param.h"
  67. ***************
  68. *** 600,607 ****
  69.           int    uid;
  70.           int    gid;
  71.       } *uap = (struct a *)u.u_ap;
  72.   
  73. !     if ((ip = owner(uap->fname, NOFOLLOW)) == NULL)
  74.           return;
  75.       u.u_error = chown1(ip, uap->uid, uap->gid);
  76.       iput(ip);
  77. - --- 600,612 ----
  78.           int    uid;
  79.           int    gid;
  80.       } *uap = (struct a *)u.u_ap;
  81. +     register struct nameidata *ndp = &u.u_nd;
  82.   
  83. !     ndp->ni_nameiop = LOOKUP | NOFOLLOW;
  84. !     ndp->ni_segflg = UIO_USERSPACE;
  85. !     ndp->ni_dirp = uap->fname;
  86. !     ip = namei(ndp);
  87. !     if (ip == NULL)
  88.           return;
  89.       u.u_error = chown1(ip, uap->uid, uap->gid);
  90.       iput(ip);
  91. ***************
  92. *** 647,655 ****
  93.           uid = ip->i_uid;
  94.       if (gid == -1)
  95.           gid = ip->i_gid;
  96. !     if (uid != ip->i_uid && !suser())
  97. !         return (u.u_error);
  98. !     if (gid != ip->i_gid && !groupmember((gid_t)gid) && !suser())
  99.           return (u.u_error);
  100.   #ifdef QUOTA
  101.       if (ip->i_uid == uid)        /* this just speeds things a little */
  102. - --- 652,664 ----
  103.           uid = ip->i_uid;
  104.       if (gid == -1)
  105.           gid = ip->i_gid;
  106. !     /*
  107. !      * If we don't own the file, are trying to change the owner
  108. !      * of the file, or are not a member of the target group,
  109. !      * the caller must be superuser or the call fails.
  110. !      */
  111. !     if ((u.u_uid != ip->i_uid || uid != ip->i_uid ||
  112. !         !groupmember((gid_t)gid)) && !suser())
  113.           return (u.u_error);
  114.   #ifdef QUOTA
  115.       if (ip->i_uid == uid)        /* this just speeds things a little */
  116.  
  117.  
  118. - -------
  119.